<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>

<HEAD>


	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>


	<LINK href="styles.css" type="text/css" rel="stylesheet">
<SCRIPT LANGUAGE="JavaScript">
	<!--
		function fnShowDetails(WalkinID,U)
			{
				var URL = U+"?WalkinID="+WalkinID;
				fnEmpPopUp(URL,500,600);
			}
	//-->
	</SCRIPT>

</HEAD>
<BODY class=Grad>
<%
int IAuth;
IAuth=(session.getAttribute("auth")==null) ? 10 :(Integer)session.getAttribute("auth");
if(IAuth==0||IAuth==1||IAuth==2){
%>
<P align=right><A href="AddNewWalkin0.jsp" target="ResultFrame" ><img border="0"
	name="AddNewWalkin" src="Images/AddNewWalkin1.jpg" width="101" height="22" onmouseover="document['AddNewWalkin'].src='Images/AddNewWalkin0.jpg'" onmouseout="document['AddNewWalkin'].src='Images/AddNewWalkin1.jpg'" ></a><P>
<%
}
%>
<h2 align=center>View Walk-in Details</h2>

<%

	Connection con=null;
	ResultSet rs=null;
	Statement stmt=null;
	try{
			
			/* Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			con = DriverManager.getConnection("jdbc:odbc:JobPortal","root",""); */
			
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jobmiller","root","root");

			stmt =  con.createStatement();
			String Query = "Select * from walkindetails order by `WalkinID`";
			rs = stmt.executeQuery(Query);
			%>
						<table align="center" width="60%">
							<tr class=row_title>
							<th align="left">WalkinID</th>
							<th align="left">JobTitle</th>
							<th align="left">CompanyName</th>
							<th align="left">Location</th>
							<th align="left">WalkinDate</th>
							</tr>
					<%
			int rCount=0;
			while(rs.next())
			{
				 String WalkinID=rs.getString(1);
				String JobTitle=rs.getString(2);
				String CompanyName=rs.getString(8);
				String Location=rs.getString(5);
				String WalkinDate=rs.getString(6);

					%>
					<tr class= <%=(rCount%2!=0)? "row_even" : "row_odd"%>>
						<td><A onclick="fnShowDetails('<%=WalkinID%>','ShowWalkin.jsp')"><%=WalkinID%></td>
						<td><%=JobTitle%></td>
						<td><%=CompanyName%></td>
						<td><%=Location%></td>
						<td><%=WalkinDate%></td>
						
					</tr>
					<%
				rCount++;
			}
			if( rCount == 0)	{%><h3 align=center>Sorry No records Found</h3><% }
			rs.close();
			stmt.close();
			con.close();
		}catch(Exception e){
			rs.close();
			stmt.close();
			con.close();
			%><%=e%><%
		}
	
%>
</BODY>


